package Jsuanji;

import java.util.Scanner;

public class Calculatortest {
    public static void main(String[] args) {
        Calculator a=new Calculator();
        a.colour="红色";
        a.price=199;
        a.brand="红双喜";
        a.show();
        int isfalg=0;
        while (true){
            Scanner in=new Scanner(System.in);
            System.out.println("请输入你需要的功能：");
            System.out.println("1.加法，2.减法，3.乘法，4.除法，5.立方，0.退出");
            int b=in.nextInt();
            if (b==1){
                System.out.println("请输入数字1:");
                int s1=in.nextInt();
                System.out.println("请输入数字2:");
                int s2=in.nextInt();
                a.jia(s1,s2);
            }else if (b==2){
                System.out.println("请输入数字1:");
                int s1=in.nextInt();
                System.out.println("请输入数字2:");
                int s2=in.nextInt();
                a.jian(s1,s2);
            }else if (b==3){
                System.out.println("请输入数字1:");
                int s1=in.nextInt();
                System.out.println("请输入数字2:");
                int s2=in.nextInt();
                a.chen(s1,s2);
            }else if (b==4){
                System.out.println("请输入数字1:");
                int s1=in.nextInt();
                System.out.println("请输入数字2:");
                int s2=in.nextInt();
                a.chu(s1,s2);
            }else if (b==5){
                System.out.println("请输入一个数字:");
                int s1=in.nextInt();
                a.lifang(s1);
            }else if (b==0){
                break;
            }
        }
    }
}
